/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cersoft.xmascharity.ejb;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import com.cersoft.xmascharity.entity.Child;
import com.cersoft.xmascharity.entity.Family;
import com.cersoft.xmascharity.entity.Image;

/**
 *
 * @author pbo
 */
@Stateless
public class FamilyFacade extends AbstractFacade<Family> {
    @PersistenceContext(unitName = "XmasCharityPU")
    private EntityManager em;

    protected EntityManager getEntityManager() {
        return em;
    }

    public void addChild(Family f, Child c) {
        f.getChildren().add(c);
        c.setFamily(f);
        em.persist(c);
    } 
    
    
    
    
    public FamilyFacade() {
        super(Family.class);
    }
    
}
